package lab1;
/*  $Id: Lab1.java
 *  
 *  Copyright 2012, The Johns Hopkins University Whiting School of Engineering
 *  All rights reserved.
 *  This material may be used, modified and reproduced by faculty,
 *  staff, and students of The Johns Hopkins University for instruction, 
 *  evaluation, and grading purposes.  For any other permission, please 
 *  contact The Johns Hopkins University Whiting School of Engineering.
 */

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.IOException;

/**
*  Lab1 1: Main Class
*  @date       01JULY2012
*  @author     Michael W. Mathes
*/
public class Lab1 {
  /**
  *  Main entry point for the program.
  *  @param args[]   Holds command line arguments:  the input filename
  *                  Note: output is sent to the command line
  */
  public static void main(String[] args) {

   String line = "";
   
    BufferedReader  input;
    rosetta Rose = new rosetta(); 
                
    //  Check for command line arguments.
    if (args.length != 1) {
      System.out.println("Usage:  java Lab1 [input file pathname]");
      System.exit(1);
    }
      
        
    //  Open the files that will be used for input and output.
    try {
      input = new BufferedReader(new FileReader(args[0]));
      line = input.readLine();         
    } catch (Exception ioe) {
      System.err.println(ioe.toString());
      return;
    }

        
    /**
    * 
    *   for each language
    *      compare string to the implemented language 
    *   and display to the output file
    * 
    * 
    */

//     // Test Block
//     line = "AABBB";
//     System.out.println(line + ": L2: " + Rose.L2(line));
    
     while (line != null){
       System.out.println(line + "\t" + ": L1: " + Rose.Lang1.L1(line)+ "\t L2: " + Rose.Lang2.L2(line) + "\t L3: " + Rose.Lang3.L3(line));
              
       
      try{line = input.readLine();}
        catch(Exception x){
      System.err.println(x.toString());
      }
        
    }
    
        
  }// end main
}// end class
